home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_commietalk.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  126 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_CommieTalk.cog
  4. #
  5. # Indy worries about the Soviets
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ==============================================================================
  11.  
  12. # NOTE: This is a random verbal reaction to the presence of Reds.
  13. # Glue it into your level and reach it from a calling cog like this:
  14. #
  15. # 1. Create a valid reference to this cog in your calling cog;
  16. #
  17. # 2. Use the following verb:
  18. #    SendMessageEx(thiscogREF, i_userMessage, f_parm0, f_parm1, f_parm2, f_parm3);
  19. #    (see each section below for details...)
  20. #
  21. # 3. Use global15 as a semaphore and return value where neeeded;
  22. #
  23. # The resulting chatter is pre-approved by HB...
  24. #
  25. # PRODUCT SUPPORT:  cogsrus x8371
  26.  
  27. # ==============================================================================
  28.  
  29. symbols
  30.  
  31. # ................................. MESSAGES ...................................
  32.  
  33.     message user0    # commie lines
  34.  
  35. # ................................. SAY LINES ..................................
  36.  
  37.     # snake lines...
  38.     sound    in_sayline=Inxj062.wav                local # Reds!-->in_sayline[0]
  39.     sound    in_commies=Inxj063.wav                local # Commies!
  40.     sound    in_comherefirst=Inxj064.wav            local # Looks like commies here first
  41.     sound    in_comagain=Inxj066.wav                local # Oh no. Commies again.
  42.     sound    in_redagain=Inxj067.wav                local # Well well. Reds again.
  43.     sound    in_redewhere=Inxj068.wav            local # Reds. They're everywhere.
  44.     sound    in_jumpreds=Inxj065.wav                local # Reds! Thought I had jump
  45.  
  46. # ............................... VARIABLES ....................................
  47.  
  48.     flex    talkerREF                            local
  49.     flex    forceTalk                            local
  50.     flex    forceLine                            local
  51.     
  52.     int        alreadyworking=0                    local
  53.  
  54.     int        newline=50                            local # init outside actual range
  55.     int        medline=50                            local
  56.     int        oldline=50                            local
  57.  
  58.     int        dummy
  59.     
  60. end
  61.  
  62. # ==============================================================================
  63.  
  64. code
  65.  
  66. # ..............................................................................
  67.  
  68. user0:
  69.  
  70.     # NOTE: Indy doesn't like the Soviets much better than he did the N's...
  71.     #
  72.     # Proper command to reach this response section from the calling cog is:
  73.     #
  74.     # SendMessageEx(negtalkcogREF, user0, f_talkerREF, f_forceTalk, f_forceLine, 0);
  75.     #
  76.     # global15 is used here like so:
  77.     #
  78.     # global15 == 0 while this cog is at work (waiting for line to finish)
  79.     # global15 == 1 upon return
  80.     #
  81.     # As discussed in user0 section, the calling cog can use global15 as a semaphore
  82.     #
  83.     # Hey!  You can also force a line choice.  Here's how:
  84.     # 1. Note your intention by setting f_forceTalk parm to some non-zero value
  85.     # 2. Examine the available lines to find the one you want (counting from 0)
  86.     # 3. Pass that number in the forceLine parameter (parm2) 
  87.  
  88.     if (alreadyworking > 0)
  89.     {
  90.         return;
  91.     }
  92.  
  93.     alreadyworking = 1; # stall multiple calls
  94.  
  95.     global15 = 0; # init each call
  96.  
  97.     talkerREF = GetParam(0); # is player or an actor talking? (a cast)
  98.     forceTalk = GetParam(1); # force a choice
  99.     forceLine = GetParam(2); # actual line choice
  100.     
  101.     if (forceTalk > 0)
  102.     {
  103.         newline = forceLine; # choose this line
  104.         medline = 0;
  105.         oldline = 0;
  106.     }
  107.     
  108.     # remember and avoid previous 2 lines...
  109.     while (newline == oldline || newline == medline)
  110.     {        
  111.         newline = RandBetween(0, 6);
  112.     }
  113.     oldline = medline;
  114.     medline = newline;
  115.  
  116.     PlayVoice(talkerREF, in_sayline[newline], 1, 1);
  117.  
  118.     global15 = 1;
  119.  
  120.     alreadyworking = 0;
  121.  
  122.     return;
  123.  
  124. end
  125.  
  126.